package flc.ast.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.youth.banner.adapter.BannerAdapter;
import com.youth.banner.util.BannerUtils;

import java.util.List;

import flc.ast.R;
import flc.ast.bean.CenterBean;
import stark.common.bean.StkResBean;

public class DrawDetailAdapter extends BannerAdapter<CenterBean, DrawDetailAdapter.ImageTitleHolder> {


    public DrawDetailAdapter(List<CenterBean> datas) {
        super(datas);
    }

    @Override
    public ImageTitleHolder onCreateHolder(ViewGroup parent, int viewType) {
        return new ImageTitleHolder(BannerUtils.getView(parent, R.layout.item_draw_detail));
    }

    @Override
    public void onBindView(ImageTitleHolder holder, CenterBean data, int position, int size) {
        Glide.with(holder.itemView).load(data.getImg()).into(holder.imageView);
    }

    public class ImageTitleHolder extends RecyclerView.ViewHolder {
        public ImageView imageView;

        public ImageTitleHolder(@NonNull View view) {
            super(view);
            imageView = view.findViewById(R.id.ivDrawDetailItemImg);
        }
    }
}
